<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Add Demo-2</title>
<script src="../jquery3-3-1/jquery-3.3.1.js"></script>
<script type="text/javascript">
$(function(){
	$(".btn").click(function(){
		var a=$("#FirstNum").val();
		var b=$("#SecondNum").val();
		var c=parseInt(a)+parseInt(b);
		$("#SumNum").val(c);	
		$("#tip").addClass("myred");
		$("#tip").html("<b>Good Job!</b>");
		});	
	}
);

</script>
<style type="text/css">
.myred{
	color:red;
}
</style>
</head>
<body>
<h2 id="tip">2018电商1班-李四 </h2>
<p>
  <input type="text" name="FirstNum" id="FirstNum">
  +
  <input type="text" name="SecondNum" id="SecondNum">
  =
  <input type="text" name="SumNum" id="SumNum">
  <button class="btn">显示结果</button>
</p>
</body>
</html>
